#include <iostream>

#include "Package.h"
#include "OvernightPackage.h"

using std::cout;
using std::endl;


OvernightPackage::OvernightPackage( double taxPerKilo, double w, double c,
        char* fName, char* fAddress, char* fCity, char* fState, char* fZIP,
        char* tName, char* tAddress, char* tCity, char* tState, char* tZIP ) :
    Package( w, c, fName, fAddress, fCity, fState, fZIP,
             tName, tAddress, tCity, tState, tZIP )
{
    _taxPerKilo = taxPerKilo > 0 ? taxPerKilo : 0.0; // R$ 0 de taxa
}

OvernightPackage::~OvernightPackage()
{
}

double OvernightPackage::getTaxPerKilo() const
{
    return _taxPerKilo;
}

double OvernightPackage::calculateCost() const
{
    return Package::calculateCost() + getTaxPerKilo() * Package::getWeight();
}

void OvernightPackage::printCost() const
{
    cout << "Costs from Overnight Package:" << endl;
    cout << "Cost: R$ " << calculateCost() << endl << endl;
}

